<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <!-- 
      插值语法:是在模板中(非属性节点)插入data中的数据,并且可能对数据进行一些计算

      插值语法中只能书写表达式,不能书写语句(和react的插值语法一致)

      插值语法中,如果数据的值是null或者undefined,则直接转为空串,如果是其他类型,则直接转为字符串格式
    -->
  <!-- <div id="app">
    <h1>{{msg}}</h1>
    <h1>{{count}}</h1>
    <h1>{{count += 1}}</h1>
    <h1>{{obj}}</h1>
    <h1>{{arr}}</h1>
    <h1>{{n}}</h1>
    <h1>{{d}}</h1>
  </div> -->

  <!-- <script>
    const vm = new Vue({
      data(){
        return{
          msg: "Oh no 😢",
          count: 1,
          obj: {
            a:1,
            b:2
          },
          arr:[1,2,3,],
          n : null,
          d: undefined
        }
      }
    }).$mount("#app")
  </script> -->




  <div id="app">
    <h1>{{msg}}</h1>
    <h1>{{count}}</h1>
    <h1>{{count += 1}}</h1>
    <h1>{{obj}}</h1>
    <h1>{{arr}}</h1>
    <h1>{{n}}</h1>
    <h1>{{d}}</h1>
  </div>

  <script>
    new Vue({
      data() {
        return {
          msg: "😢😢😢😢😢😢",
          count: 1,
          obj: {
            a:1,
            b:2
          },
          arr:[1,2,3]
        }
      }
    }).$mount("#app")
  </script>


</body>

</html>